#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2018, Niklas Hauser
# Copyright (c) 2017-2018, Fabian Greif
# Copyright (c) 2018, Raphael Lehmann
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


def init(module):
    module.name = ":test:driver"
    module.description = "Tests for External Drivers"


def prepare(module, options):
    module.depends(
        "modm:architecture:clock",
        "modm:debug",
        "modm:driver:ad7280a",
        "modm:driver:bme280",
        "modm:driver:bmp085",
        "modm:driver:lawicel",
        "modm:driver:ltc2984",
        "modm:driver:drv832x_spi",
        "modm:driver:mcp2515",
        "modm:driver:block.allocator",
        "modm:driver:tmp12x",
        "modm:platform:gpio",
        ":mock:spi.device",
        ":mock:spi.master")
    return True


def build(env):
    env.outbasepath = "modm-test/src/modm-test/driver"
    patterns = []
    if env[":target"].identifier["platform"] == "avr":
        patterns += ["*pressure*"]
    env.copy('.', ignore=env.ignore_patterns(*patterns))
